#include "latchandnixie.h"
#include "kdbandtimer.h"

static unsigned char KEY = 0;

void main(void)
{
	Latch(RELAY,0x00);
	Timer2Init();
	while(1)
	{
		k();
		KEY = kn_return();
//		if(KEY)
		nixie_s(1,KEY);
//		nixie_s(2,3);
//		nixie_s(4,3);
//		nixie_s(5,3);
	}
}

void timer2() interrupt 12 using 1
{
	static unsigned char count = 0;
	T2L = 0x20;		//设置定时初值
	T2H = 0xD1;		//设置定时初值
	if(++count == 20)
	{
		key_loop();
		count = 0;
	}
	nixie_loop();
}